package common;

import java.io.Serializable;

public class Message implements Serializable {
    private static final long serialVersionUID = 1L;

    private String content;
    private String sender;
    private String getter;
    private MessageStatus type;
    private String send_time;


    private boolean have_offline_message=false;
    private int offline_messages;
    private MessageStatus type_of_chat;

    //文件
    private String fileName;
    private byte[] fileBytes;
    private long fileLength;


    public Message(){}

    public MessageStatus getType_of_chat() {
        return type_of_chat;
    }

    public void setType_of_chat(MessageStatus type_of_chat) {
        this.type_of_chat = type_of_chat;
    }

    public int getOffline_messages() {
        return offline_messages;
    }

    public void setOffline_messages(int offline_messages) {
        this.offline_messages = offline_messages;
    }

    public void setHave_offline_message(boolean have_offline_message) {
        this.have_offline_message = have_offline_message;
    }

    public boolean isHave_offline_message() {
        return have_offline_message;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public byte[] getFileBytes() {
        return fileBytes;
    }

    public void setFileBytes(byte[] fileBytes) {
        this.fileBytes = fileBytes;
    }

    public long getFileLength() {
        return fileLength;
    }

    public void setFileLength(long fileLength) {
        this.fileLength = fileLength;
    }




    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getGetter() {
        return getter;
    }

    public void setGetter(String getter) {
        this.getter = getter;
    }


    public MessageStatus getType() {
        return type;
    }

    public void setType(MessageStatus type) {
        this.type = type;
    }

    public String getSend_time() {
        return send_time;
    }

    public void setSend_time(String send_time) {
        this.send_time = send_time;
    }
    @Override
    public String toString() {
        return "\n"+send_time+" to "+getter+" "+type+"\n"+
                sender+":"+content;
    }
}
